/**
 * @description: 镜像管理
 */

import type { CommonAPI } from '../types/all'
import { defHttp } from '../http'

/** 修改镜像可见性 */
export const updateManageImageVisibilityByIdApi: CommonAPI<
  '/v1/manage/image/visibility/{region_id}/{image_id}',
  'put'
> = data =>
  defHttp.put(
    `/v1/manage/image/visibility/${data.region_id}/${data.image_id}`,
    data,
  )

/** 删除镜像 */
export const deleteManageImageByIdApi: CommonAPI<
  '/v1/manage/image/{region_id}/{image_id}',
  'delete'
> = params =>
  defHttp.delete(`/v1/manage/image/${params.region_id}/${params.image_id}`, {
    params,
  })

/** 镜像列表 */
export const getManageImagesListApi: CommonAPI<
  '/v1/manage/images',
  'get'
> = params => defHttp.get(`/v1/manage/images`, { params })

/** 镜像列表简略信息列表 */
export const getManageImagesSimpleListApi: CommonAPI<
  '/v1/manage/images/simple',
  'get'
> = params => defHttp.get(`/v1/manage/images/simple`, { params })
